{% set navs = [
    {
        name: '雪碧图生成工具',
        link: '/css_sprite'
    },{
        name: '正则解析工具',
        link: '/regexper'
    },{
        name: 'matrix3d工具',
        link: '/matrix3d'
    }] %}
<header class="header navbar navbar-dark navbar-expand-md bg-primary">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggler" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a href="/" class="navbar-brand">Fcheng's Tools</a>
            </div>
            <div class="collapse navbar-collapse" id="header-nav">
                <ul class="nav navbar-nav main-nav">
                    {% for item in navs %}
                        <li class="nav-item {% if item.name === activeNav %}active{% endif %}">
                            <a href="{{ item.link }}" class="nav-link">{{ item.name }}</a>
                            {% if item.children %}
                                <ul class="second-nav list-unstyled">
                                    {% for snav in item.children %}
                                        <li class="nav-item"><a href="{{ snav.link }}" class="nav-link">{{ snav.name }}</a></li>
                                    {% endfor %}
                                </ul>
                            {% endif %}
                        </li>
                    {% endfor %}
                </ul>
            </div>
        </div>
</header>